package com.ynet.middleground.approve.constant;

/**
 * @author liulx
 * @description 工作流常用静态量
 * @date 2019-11-06 09:12
 */
public final class WorkflowConstants {

    /**
     * 流程变量前缀
     */
    public static final String FLOW_VARIABLE_PREFIX = "flow_";

    /**
     * 流程发起渠道标志
     */
    public static final String CHANNEL_SIGNAL = FLOW_VARIABLE_PREFIX + "channel_signal";

    /**
     * 流程发起业态标志
     */
    public static final String FORMAT_SIGNAL = FLOW_VARIABLE_PREFIX + "format_signal";

    /**
     * 可以处理该流程实例的渠道标志，若传多个，用英文逗号隔开，例：C01,C02
     */
    public static final String FLOW_CAN_OPERATE_CHANNEL_SIGNAL = FLOW_VARIABLE_PREFIX + "can_operate_channel_signal";

    /**
     * 可以处理该流程实例的业态编码，若传多个，用英文逗号隔开，例：000001,000002
     */
    public static final String FLOW_CAN_OPERATE_FORMAT_SIGNAL = FLOW_VARIABLE_PREFIX + "can_operate_format_signal";

    /**
     * businessKey，主要用于流程实例与业务关联
     */
    public static final String BUSINESS_KEY = FLOW_VARIABLE_PREFIX + "business_key";

    /**
     * business_user_id,流程业务主体客户,流程发起人可以和业务主体客户不是同一人
     */
    public static final String BUSINESS_USER_ID = FLOW_VARIABLE_PREFIX + "business_user_id";

    /**
     * 发起人变量
     */
    public static final String START_USER_ID = FLOW_VARIABLE_PREFIX + "start_user_id";

    /**
     * 操作人变量
     */
    public static final String OPERATION_USER_ID = FLOW_VARIABLE_PREFIX + "operation_user_id";

    /**
     * 流程实例ID
     */
    public static final String FLOW_PROCESS_INSTANCE_ID = FLOW_VARIABLE_PREFIX + "process_instance_id";

    /**
     * 流程名称
     */
    public static final String FLOW_PROCESS_NAME = FLOW_VARIABLE_PREFIX + "process_name";

    /**
     * 流程发起时间戳
     */
    public static final String FLOW_START_TIME = FLOW_VARIABLE_PREFIX + "start_time";

    /**
     * 参数变量-监听器设置审批用户, 设置 assignee 字段
     */
    public static final String LISTENER_SET_USER = "listener_set_user";

    /**
     * 参数变量-监听器设置候选人, 设置 candidateUsers
     */
    public static final String LISTENER_SET_CANDIDATE_USERS = "listener_set_candidate_users";

    /**
     * 参数变量-监听器设置候选组, 设置 candidateGroups
     */
    public static final String LISTENER_SET_CANDIDATE_GROUPS = "listener_set_candidate_groups";

    /**
     * 参数变量-网关条件变量, 控制排他网关流程分支走向
     */
    public static final String EXCLUSIVE_GATEWAY_VARIABLE = "exclusive_gateway_variable";

    /**
     * 参数变量-用户审批结果 {@link OperatingTypeEnum}
     */
    public static final String USER_TASK_APPROVE_RESULT = "user_task_approve_result";

    /**
     * 变量值-用于流程图会签网关，不通过时使用
     */
    public static final String USER_TASK_APPROVE_RESULT_FAIL = "fail";

    /**
     * 变量值-用于流程图会签网关，通过时使用
     */
    public static final String USER_TASK_APPROVE_RESULT_PASS = "pass";

    /**
     * 设置流程审批人，审批人是部门时，前缀是 d: <br />
     * 规则为 d:部门id <br />
     * 例如 d:1001
     */
    public static final String CANDIDATE_GROUP_DEPARTMENT_PREFIX = "d:";

    /**
     * 设置流程审批人，审批人是部门-角色时，前缀是 dr: <br />
     * 规则为 d:部门id-角色id <br />
     * 例如 dr:1001-1001
     */
    public static final String CANDIDATE_GROUP_DEPARTMENT_ROLE_PREFIX = "dr:";

    /**
     * 设置流程审批人，审批人是企业-角色时，前缀是 er: <br />
     * 规则为 er:企业角色id <br />
     * 例如 er:1001
     */
    public static final String CANDIDATE_GROUP_ENTERPRISE_ROLE_PREFIX = "er:";

    /**
     * 设置流程审批人，审批人是部门-角色时，部门角色之间的分隔符
     */
    public static final String CANDIDATE_GROUP_DEPARTMENT_ROLE_DELIMITER = "-";

    /**
     * 任务定义 key，用于记录是从哪个节点退回或驳回 <br/>
     */
    public static final String FLOW_FROM_TASK_DEFINITION_KEY = FLOW_VARIABLE_PREFIX + "from_task_definition_key";

    /**
     * 任务定义 key，用于记录是从哪个节点退回或驳回时的具体操作，具体参数值参考 <br/>
     * 驳回: {@link OperatingTypeEnum#REJECT} <br/>
     * 退回: {@link OperatingTypeEnum#RETURN} <br/>
     * 回转: {@link OperatingTypeEnum#ROTATE}
     */
    public static final String FLOW_FROM_TASK_OPERATE = FLOW_VARIABLE_PREFIX + "from_task_operate";

    /**
     * 公司名称
     */
    public static final String FLOW_COMPANY_NAME = FLOW_VARIABLE_PREFIX + "company_name";
    /**
     * 产品名称
     */
    public static final String FLOW_PRODUCT_NAME = FLOW_VARIABLE_PREFIX + "product_name";
    /**
     * 流程发起人姓名
     */
    public static final String FLOW_START_USER_NAME = FLOW_VARIABLE_PREFIX + "start_user_name";

    /**
     * 金控经办人员ID
     */
    public static final String FLOW_BUSINESS_QDPF_OPERATOR = FLOW_VARIABLE_PREFIX + "business_qdpf_operator";

    /**
     * 金控经办人员钉钉ID
     */
    public static final String FLOW_BUSINESS_QDPF_DINGTALK_USERID =
        FLOW_VARIABLE_PREFIX + "business_qdpf_dingtalk_userid";

    /**
     * 金控经办人员姓名
     */
    public static final String FLOW_BUSINESS_QDPF_OPERATOR_NAME = FLOW_VARIABLE_PREFIX + "business_qdpf_operator_name";

    /**
     * 流程摘要
     */
    public static final String FLOW_BUSINESS_SUMMARY = FLOW_VARIABLE_PREFIX + "business_summary";

    /**
     * 流程优先级
     */
    public static final String FLOW_PROCESS_PRIORITY = FLOW_VARIABLE_PREFIX + "process_priority";

    /**
     * 业务场景
     */
    public static final String FLOW_BUSINESS_SCENE = FLOW_VARIABLE_PREFIX + "business_scene";

    /**
     * 业务数据
     */
    public static final String FLOW_BUSINESS_DATA = FLOW_VARIABLE_PREFIX + "business_data";

    /**
     * 移动审批待签章文件列表 <br/>
     * 其值为 FilesToBeSignedBean 对象集合，参考: {@link com.ynet.middleground.approve.bean.FilesToBeSignedBean}
     */
    public static final String FLOW_LIST_OF_FILES_TO_BE_SIGNED = FLOW_VARIABLE_PREFIX + "list_of_files_to_be_signed";

    /**
     * 业务操作记录(移动端操作记录)
     */
    public static final String FLOW_OPERATE_TASK_OPERATE_RECORD_DATA =
        FLOW_VARIABLE_PREFIX + "operate_task_operate_record_data";

    /**
     * 移动审批端可处理的标志 <br>
     * 如果任务变量中有该变量，说明该任务可以在移动审批端处理
     */
    public static final String FLOW_TASK_MOBILE_PROCESS = FLOW_VARIABLE_PREFIX + "task_mobile_process";

    /**
     * 标识审批操作在移动审批端处理 <br>
     * 如果任务变量中有该变量，说明该任务是在移动审批端处理
     */
    public static final String FLOW_TASK_DONE_MOBILE_PROCESS = FLOW_VARIABLE_PREFIX + "task_done_mobile_process";

    /**
     * 业务动作参数变量名<br>
     * 该参数的值，是由绘制流程时，通过监听器添加 {@link com.ynet.middleground.approve.listener.TaskTipsListener}
     */
    public static final String FLOW_BUSINESS_OPERATE_DATA = FLOW_VARIABLE_PREFIX + "business_operate_data";

    /**
     * 实际业务发起时间
     */
    public static final String FLOW_BUSINESS_START_TIME = FLOW_VARIABLE_PREFIX + "business_start_time";

}
